package main.od;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class LongSignal {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String signal = sc.nextLine();
        Pattern pattern = Pattern.compile("^(01)+0$");
        int maxLength = 0;
        String result = "";
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0;i < signal.length();i++){
            char c = signal.charAt(i);
            if (c == '0' && stringBuilder.length() > 0
                    && stringBuilder.charAt(stringBuilder.length() - 1) == '0'){
                Matcher matcher = pattern.matcher(stringBuilder);
                if (matcher.find() && stringBuilder.length() > maxLength){
                    maxLength = stringBuilder.length();
                    result = stringBuilder.toString();
                }
                stringBuilder = new StringBuilder();
            }
            stringBuilder.append(c);
        }
        Matcher matcher = pattern.matcher(stringBuilder);
        if (matcher.find() && stringBuilder.length() > maxLength){
            maxLength = stringBuilder.length();
            result = stringBuilder.toString();
        }
        System.out.println(result);
    }

}
